/**
 * slippry v1.2 - Simple responsive content slider
 * http://slippry.com
 *
 * Author(s): Lukas Jakob Hafner - @saftsaak
 *            Thomas Hurd - @SeenNotHurd
 *
 * Copyright 2013, booncon oy - http://booncon.com
 *
 * Thanks @ http://bxslider.com for the inspiration!
 *
 * Released under the MIT license - http://opensource.org/licenses/MIT
 */
 
@import "compass";

$color_high: #e24b70;     // highlight colour
$color_gray: #ccc;        // neutral colour
$controls_size: 2.8em;    // size of the next/ prev buttons
$pager_size: 1.2em;       // size of the pager bubbles
$trans_ease: ease;        // easing for the transitions
$mobile_break: 600px;     // breakpoint to use some special mobile styling

/* -------------------------- MIXINS ---------------------------------- */
@mixin keyframes($name) {
  @-webkit-keyframes #{$name} {
    @content; 
  }
  @-moz-keyframes #{$name} {
    @content;
  }
  @-ms-keyframes #{$name} {
    @content;
  }
  @keyframes #{$name} {
    @content;
  } 
}

@mixin animation ($animation) {
  -webkit-animation-name: $animation;
  -webkit-animation-fill-mode: forwards;
  -moz-animation-name: $animation;
  -moz-animation-fill-mode: forwards;
  -o-animation-name: $animation;
  -o-animation-fill-mode: forwards;
  animation-name: $animation;
  animation-fill-mode: forwards;
}
/* -------------------------- END MIXINS ---------------------------------- */

/* kenBurns animations, very basic */
@include keyframes(left-right) {
  0% {
    @include transform(translateY(-20%) translateX(-10%));
  }
  100% {
    @include transform(translateY(0%) translateX(10%));
  }
}
@include keyframes(right-left) {
  0% {
    @include transform(translateY(0%) translateX(10%));
  }
  100% {
    @include transform(translateY(-20%) translateX(-10%));
  }
}
/* added to the original element calling slippry */
.sy-box {
  &.sy-loading {
    .sy-slides-wrap, .sy-pager {
      visibility: hidden;
    }
    background: url(assets/img/sy-loader.gif) 50% 50% no-repeat;
    @include background-size(32px);
    min-height: 40px;
  }
}
/* element that wraps the slides */
.sy-slides-wrap {
  position: relative;
  height: 100%;
  width: 100%;
  &:hover {
    .sy-controls {
      display: block;
    }
  }
}
/* element that crops the visible area to the slides */
.sy-slides-crop {
  height: 100%;
  width: 100%;
  position: absolute;
  overflow: hidden;
}
/* list containing the slides */
.sy-list {
  &.horizontal {
    @include transition(left $trans_ease);
  }
  &.vertical {
    @include transition(top $trans_ease);
  }
  width: 100%;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
}
/* single slide */
.sy-slide {
  position: absolute;
  width: 100%;
  z-index: 2;
  &.kenburns {
    width: 140%;
    left: -20%;
    &.useCSS {
      &.sy-ken {
        &:nth-child(1n) {
          @include animation(left-right);
        }
        &:nth-child(2n) {
          @include animation(right-left);
        }
      }
      @include transition-property(opacity);
    }  
  }
  &.sy-active {
    z-index: 3;
  }
  >a { // styling for link on whole slide
    margin: 0;
    padding: 0;
    display: block;
    width: 100%;
    >img { // with one image as content -> full size
      margin: 0;
      padding: 0;
      display: block;
      width: 100%;
      border: 0;
    }
  }
}
/* next/ prev buttons, with arrows and clickable area a lot larger than the visible buttons */
.sy-controls {
  display: none;
  list-style: none;
  height: 100%;
  width: 100%;
  position: absolute;
  padding: 0;
  margin: 0;
  li {
    position: absolute;
    width: 10%;
    min-width: $controls_size * 1.5;
    height: 100%;
    z-index: 33;
    &.sy-prev {
      left: 0;
      top: 0;
      a {
        &:after {
          background-position: -5% 0;
        }
      }
    }
    &.sy-next {
      right: 0;
      top: 0;
      a {
        &:after {
          background-position: 105% 0;
        }
      }
    }
    a {
      position: relative;
      width: 100%;
      height: 100%;
      display: block;
      text-indent: -9999px;
      &:link, &:visited {
        opacity: 0.4;
      }
      &:hover, &:focus {
        opacity: 0.8;
        outline: none;
      }
      &:after {
        content: "";
        background-image: url(assets/img/arrows.svg);
        background-repeat: no-repeat;
        @include background-size(cover);
        text-align: center;
        text-indent: 0;
        line-height: $controls_size;
        color: #111;
        font-weight: 800;
        position: absolute;
        background-color: #fff;
        width: $controls_size;
        height: $controls_size;
        left: 50%;
        top: 50%;
        margin-top: -$controls_size / 2;
        margin-left: -$controls_size / 2;
        @include border-radius(50%);
      }
    }
  }  
  @media only screen and (max-device-width : $mobile_break) {
    display: block;
    $controls_size: $controls_size / 2;
    li {
      min-width: $controls_size * 1.5;
      a {
        &:after {
          width: $controls_size;
          height: $controls_size;
          margin-top: -$controls_size / 2;
          margin-left: -$controls_size / 2;
        }
      }
    }
  }
}
/* captions, styled fo the overlay variant */
.sy-caption-wrap {
  position: absolute;
  bottom: 2em;
  z-index: 12;
  left: 50%;
  .sy-caption {
    position: relative;
    left: -50%;
    background-color: rgba(0,0,0,0.54);
    color: #fff;        
    padding: 0.4em 1em;
    @include border-radius(1.2em);
    a {
      &:link, &:visited {
        color: $color_high;
        font-weight: 600;
        text-decoration: none;
      }
      &:hover, &:focus {
        text-decoration: underline;
      }
    }
  }
  @media only screen and (max-device-width : $mobile_break), screen and (max-width : $mobile_break) {
    left: 0;
    bottom: 0.4em;
    .sy-caption {
      left: 0;
      padding: 0.2em 0.4em;
      font-size: 0.92em;
      @include border-radius(0);
    }  
  }  
}
/* pager bubbles */
.sy-pager {
  @include clearfix;
  display: block;
  width: 100%;
  margin: 1em 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
  li {
    display: inline-block;
    width: $pager_size;
    height: $pager_size;
    margin: 0 1em 0 0;
    @include border-radius(50%);
    &.sy-active {
      a {
        background-color: $color_high;
      }
    }
    a {
      width: 100%;
      height: 100%;
      display: block;
      background-color: $color_gray;
      text-indent: -9999px;
      &:link, &:visited {
        opacity: 1.0;
      }
      &:hover, &:focus {
        opacity: 0.6;
      }
      @include background-size(2em);
      @include border-radius(50%);
    }
  }
}
/* element to "keep/ fill" the space of the content, gets intrinsic height via js */
.sy-filler {
  width: 100%;
  &.ready {
    @include transition(padding 600ms ease);
  }
}